package com.woniuxy.service.impl;

import com.woniuxy.entity.IProjects;
import com.woniuxy.dao.IProjectsDao;
import com.woniuxy.service.IProjectsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (IProjects)表服务实现类
 *
 * @author makejava
 * @since 2021-05-15 14:52:36
 */
@Service("iProjectsService")
public class IProjectsServiceImpl implements IProjectsService {
    @Resource
    private IProjectsDao iProjectsDao;

    /**
     * 通过ID查询单条数据
     *
     * @param iprjId 主键
     * @return 实例对象
     */
    @Override
    public IProjects queryById(Integer iprjId) {
        return this.iProjectsDao.queryById(iprjId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<IProjects> queryAllByLimit(int offset, int limit) {
        return this.iProjectsDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param iProjects 实例对象
     * @return int
     */
    @Override
    public int insert(IProjects iProjects) {

        return this.iProjectsDao.insert(iProjects);
    }

    /**
     * 修改数据
     *
     * @param iProjects 实例对象
     * @return 实例对象
     */
    @Override
    public int update(IProjects iProjects) {

        return this.iProjectsDao.update(iProjects);
    }

    /**
     * 通过主键删除数据
     *
     * @param iprjId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer iprjId) {
        return this.iProjectsDao.deleteById(iprjId) > 0;
    }


    /**
     * Description : Iproject表跟project表联查所有数据  <br/>
     * ChangeLog : 1. 创建 ( 20:32 [Hello Mr. Guo]);
     *
     * @return java.util.List<com.woniuxy.entity.IProjects>
    */

    @Override
    public List<IProjects> selectAll() {
        List<IProjects> iProjects = this.iProjectsDao.selectAll();
        return iProjects;
    }

    /**
     * Description : 模糊查询  <br/>
     * ChangeLog : 1. 创建 ( 21:03 [Hello Mr. Guo]);
     *
     * @return java.util.List<com.woniuxy.entity.IProjects>
    */

    @Override
    public List<IProjects> queryAll(IProjects iProject) {
        List<IProjects> iProjects = this.iProjectsDao.queryAll(iProject);
        return iProjects;
    }

    /**
     * Auther: Hello Mr. Guo  <br/>
     * Date: 16:30:2021/5/24  <br/>
     * Description:根据项目类型id获取所有项目数据
     */
    @Override
    public List<IProjects> queryByFid(int iprjPname) {
        List<IProjects> query = this.iProjectsDao.queryByFid(iprjPname);
        return query;
    }
}
